<template>
	<view>
		<view class="item" @click="navTo('/pages/user/wallet/yue')">
			<view class="item-left">余额</view>
			<view>
				<text class="item-right">{{info.balance}}</text>
				<u-icon name="arrow-right" color="#909090" size="20"></u-icon>
			</view>
		</view>
		<view class="item" @click="navTo('/pages/user/wallet/point')">
			<view class="item-left">积分</view>
			<view>
				<text class="item-right">{{info.integral}}</text>
				<u-icon name="arrow-right" color="#909090" size="20"></u-icon>
			</view>
		</view>
		<view class="item" @click="navTo('/pages/user/wallet/CGC')">
			<view class="item-left">CGC</view>
			<view>
				<text class="item-right">{{info.cgc}}</text>
				<u-icon name="arrow-right" color="#909090" size="20"></u-icon>
			</view>
		</view>
		<view class="item" @click="navTo('/pages/user/wallet/collcode')">
			<view class="item-left">收款码</view>
			<view>
				<!-- <text class="item-right">￥200</text> -->
				<u-icon name="arrow-right" color="#909090" size="20"></u-icon>
			</view>
		</view>
		<!-- <view class="item">
			<view class="item-left">银行卡</view>
			<view>
				<text class="item-right">￥200</text>
				<u-icon name="arrow-right" color="#909090" size="20"></u-icon>
			</view>
		</view> -->
	</view>
</template>

<script>
	import {userinfo} from"../../../api/user.js"
	export default{
		data(){
			return{
				info:{}
			}
		},
		onLoad() {
			
		},
		onNavigationBarButtonTap(e){
			uni.navigateTo({
				url:'./detailed'
			})
		},
		onShow() {
			this.getuserinfo()
		},
		methods:{
			navTo(url){
				uni.navigateTo({
					url:url
				})
			},
			// 获取用户资料
			async getuserinfo(){
				let res=await this.get(userinfo)
				this.info=res.data
				uni.setStorageSync("user",res.data)
			}
		}
	}
</script>

<style>
	.item{
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 30rpx;
		width: 750rpx;
		height: 97rpx;
		border-bottom: 1px solid #ECECEC;
	}
	.item-left{
		font-size: 26rpx;
		font-weight: bold;
		color: #333333;
	}
	.item-right{
		margin-right: 10rpx;
		font-size: 26rpx;
		font-weight: 400;
		color: #333333;
	}
</style>
